package com.software.loginregister.adapter;

import androidx.annotation.NonNull;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import com.software.loginregister.fragment.mineFrgment.FollowListFragment;

public class FollowPagerAdapter extends FragmentStateAdapter {
    private static final int NUM_PAGES = 2;

    public FollowPagerAdapter(@NonNull FragmentActivity fragmentActivity) {
        super(fragmentActivity);
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        // 根据位置返回对应的Fragment
        return FollowListFragment.newInstance(position == 0);
    }

    @Override
    public int getItemCount() {
        return NUM_PAGES;
    }
}
